package com.e3.basdoc.region.client;

import java.util.List;

import com.e3.basdoc.region.model.RegionModel;
import com.e3.template.tgf.TGFTreePanelAsync;
import com.google.gwt.user.client.rpc.AsyncCallback;

public class RegionTreePanel extends TGFTreePanelAsync<RegionModel> {
	
	private RegionRPCServiceAsync service = RegionRPCService.Util.getInstance();

	@Override
	public String getTreeDisplayFieldName() {
		return RegionModel.NAME;
	}

	@Override
	public void excuteLoadModelChildren(final RegionModel pModel,AsyncCallback<List<RegionModel>> callback) {
		service.getRegionChildren(pModel, callback);
	}

	@Override
	public String getRootDisplayName() {
		return RegionMessages.INSTANCE.tree_root_name();
	}

	@Override
	protected boolean isRootModel(RegionModel model) {
		return RegionHelper.INSTANCE.isRootModel(model);
	}

}
